package com.hadwinling.lot.config;

import org.apache.iotdb.rpc.IoTDBConnectionException;
import org.apache.iotdb.session.Session;
import org.springframework.beans.factory.annotation.Value;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description:
 * @author: hadwinling
 * @time: 2021/2/5 下午3:02
 */
@Configuration
class lotConfig {
    @Value("${spring.iotdb.ip}")
    private String ip;

    @Value("${spring.iotdb.port}")
    private int port;

    @Value("${spring.iotdb.user}")
    private String user;

    @Value("${spring.iotdb.password}")
    private String password;

    @Value("${spring.iotdb.fetchSize}")
    private int fetchSize;

    @Bean
    public Session lotSession() throws IoTDBConnectionException {
        System.out.println("config");
        Session session = new Session("127.0.0.1", 6667, "root", "root");
        session.open(false);


        System.out.println(session);
        return session;
    }
}